<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue使用之作用域插槽</title>
    <script src="../vue.min.js" type="text/javascript"></script>
</head>
<body>
<div id="app">
    <boy>
        <template slot-scope="data">
            <div>{{data.msg}}</div>
        </template>
    </boy>
</div>

<script type="text/javascript">
    Vue.component("boy",{
        template:`
            <div>
                <slot :msg="msg"></slot>
            </div>
        `,
        data(){
            return {
                msg:'hello,我是黄小强'
            }
        }
    })
    var app = new Vue({
        el: '#app',
        data: {

        }
    })
</script>
</body>
</html>